﻿using System.Collections.Generic;
using System.Linq;

namespace Core
{
    public static class ListExtensions
    {
        public static bool IsEmpty<T>(this List<T> list)
        {
            return list.Count == 0;
        }

        public static bool IsActive<T>(this List<T> list, int index) {
            return index >= 0 && index < list.Count;
        }
    }

    public static class ListUtils {
        public static List<T> CreateList<T>(int size = 0) {
            return Enumerable.Repeat(default(T), size).ToList();
        }
    }
}